package ex_class;

public class OverloadingExam {
	static int add(int a, int b) {
		return a + b;
	}
	
	static int add(int a, int b, int c) {
		return a + b + c;
	}
	
	static double add(double a, double b) {
		return a + b;
	}
	
	static int add(int ... a) {
		int sum = 0;
		for (int i = 0; i < a.length; i++) {
			sum += a[i];
		}
		return sum;
	}
	
	public static void main(String[] args) {
		System.out.println(OverloadingExam.add(3, 4));
		System.out.println(OverloadingExam.add(1, 2, 3));
		System.out.println(OverloadingExam.add(3, 4, 5, 6, 7, 8, 9));
	}
}
